package books4africa

////////////////////////////////////////////
//Teacher domain class
//
//contains fields of relevant information that
//teachers requesting books will provide.


class Teacher extends SecUser {
	
	
	static hasMany = [inventoryLists : InventoryList, donationLists : DonationList, bookRequests : BookRequest];
	
	byte[] teacherPhoto;
	byte[] schoolPhoto; 
	
	//necessary personal info
	//String username;
	//String password;
	String firstName;
	String lastName;
	String schoolName;
	String streetAddress; 
	String town;
	String region;
	String country;
	String phoneNum;
	int gradeLevel;
	
	//optional photos of school
	

    static constraints = {
		//grade level must be between 0 and 6
		firstName();  
		lastName();
		//username(size: 3..20, unique: true);
		//password(size: 6..8, nullable: true);//this is only nullable for the time being
		schoolName();
		streetAddress();
		town();
		region();
		country();//drop down box
		phoneNum();
		gradeLevel(validator: {grade ->
			grade >= 0 && grade < 7});				
		teacherPhoto(nullable: true, maxsize: 100000);
		schoolPhoto(nullable: true);
    }
}
